| Fully Qualified Name: | Laminas\Filter\File\Rename |
| Extends: | AbstractFilter |
| Name | Description | Defined By |
|---|---|---|
| __construct() | Class constructor | Rename |
| addFile() | Adds a new file or directory as target to the existing ones | Rename |
| filter() | Defined by Laminas\Filter\Filter | Rename |
| getFile() | Returns the files to rename and their new name and location | Rename |
| getNewName() | Returns only the new filename without moving it But existing files will be erased when the overwrite option is true | Rename |
| setFile() | Sets a new file or directory as target, deleting existing ones | Rename |
Class constructor
Options argument may be either a string, a Laminas\Config\Config object, or an array. If an array or Laminas\Config\Config object, it accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the source file 'overwrite' => Shall existing files be overwritten ? 'randomize' => Shall target files have a random postfix attached?
| Parameter Name | Type | Description |
|---|---|---|
| $options | string|array|\Traversable | Target |
Returns:
Adds a new file or directory as target to the existing ones
Array accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the sourcefile 'overwrite' => Shall existing files be overwritten? 'randomize' => Shall target files have a random postfix attached?
| Parameter Name | Type | Description |
|---|---|---|
| $options | string|array | Old |
Returns: \Rename
Defined by Laminas\Filter\Filter
Renames the file $value to the new name set before Returns the file $value, removing all but digit characters
| Parameter Name | Type | Description |
|---|---|---|
| $value | string|array | Full |
Returns: string|array The new filename which has been set
Returns the files to rename and their new name and location
Returns: array
Returns only the new filename without moving it But existing files will be erased when the overwrite option is true
| Parameter Name | Type | Description |
|---|---|---|
| $value | string | Full |
| $source | bool | Return |
Returns: string The new filename which has been set
Sets a new file or directory as target, deleting existing ones
Array accepts the following keys: 'source' => Source filename or directory which will be renamed 'target' => Target filename or directory, the new name of the sourcefile 'overwrite' => Shall existing files be overwritten? 'randomize' => Shall target files have a random postfix attached?
| Parameter Name | Type | Description |
|---|---|---|
| $options | string|array | Old |
Returns: self